<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table {
            width: 800px;
            border: 1px solid black;
            border-collapse: collapse;
        }
        tr,th,td {
            border: 1px solid black;
            text-align: center;
        }
    </style>
</head>
<body>
    <script>
        var uname = "张三"
        var age = 18
        var sex = "男"
        var height = 188
        var str = `<table>
        <tr>
            <th>姓名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>身高</th>
        </tr>
        <tr>
            <td>${uname}</td>
            <td>${age}</td>
            <td>${sex}</td>
            <td>${height}</td>           
        </tr>
    </table> `
    document.write(str)
    </script>
    
</body>
</html>